***********************************************************
* Replication archive for
* Megumi Naoi/Ikuo Kume. (2015) 
* "Workers or Consumers? A Survey Experiment on the Duality of Citizens� Interests in the Politics of Trade"
* Forthcoming in Comparative Political Studies
* Available at: AUTHOR's WEBSITE
***********************************************************


**Figure 1: The Gap between % Support for Free Trade in Job vs. Consumption Dimensions **** 
***Download ISSP 2003 data from: http://zacat.gesis.org/webview/index.jsp?object=http://zacat.gesis.org/obj/fStudy/ZA3910 (requires registration)***
*****Source: ZA3910: International Social Survey Programme: National Identity II - ISSP 2003*****
use ZA3910_v2-1-0.dta

keep C_ALPHAN v36 v42 
keep if C_ALPHAN=="AT"|C_ALPHAN=="AU"|C_ALPHAN=="CA"|C_ALPHAN=="CH"|C_ALPHAN=="DE"|C_ALPHAN=="FR"|C_ALPHAN=="NO"|C_ALPHAN=="US"|C_ALPHAN=="GB"|C_ALPHAN=="SE"|C_ALPHAN=="NZ"|C_ALPHAN=="DK"|C_ALPHAN=="PT"|C_ALPHAN=="ES"|C_ALPHAN=="JP"|C_ALPHAN=="IE"|C_ALPHAN=="KR" 
rename C_ALPHAN country
rename v36 limitimports_disagree
rename v42 consumer_disagree

gen job_benefits=1 if limitimports_disagree>3
replace job_benefits=0 if limitimports_disagree<4

gen consumer_benefits=1 if consumer_disagree<3
replace consumer_benefits=0 if consumer_disagree>2

by country, sort: egen avg_jobbenefits=mean(job_benefits) 
by country, sort: egen avg_consumerbenefits=mean(consumer_benefits) 

by country, sort: gen lag=country[_n-1]
gen dup=1 if lag==country
drop if dup==1

graph dot avg_jobbenefits avg_consumerbenefits, over(country, sort(avg_jobbenefits)) scheme(lean1)

clear
**********Recode Variables********************
clear

use cps2015_naoi_kume_workersconsumers.dta

recode imports_bad (1=5) (2=4) (3=3) (4=2) (5=1) (6=.), gen(freetrade)

gen support_freetrade=1 if freetrade>3
replace support_freetrade=0 if freetrade<4
replace support_freetrade=. if freetrade==.

gen neutral_freetrade=1 if freetrade==3
replace neutral_freetrade=0 if neutral==.
replace neutral_freetrade=. if freetrade==.

gen oppose_freetrade=1 if freetrade>4
replace oppose_freetrade=0 if oppose_freetrade==.
replace oppose_freetrade=. if freetrade==.

gen lowincome=1 if income_continuous<5
replace lowincome=0 if income_continuous>4

gen midincome=1 if income_continuous<10 & income_continuous>4
replace midincome=0 if income_continuous<5 | income_continuous >9

gen highincome=1 if income_continuous>9
replace highincome=0 if income_continuous<10

gen brandshopper=armani+brooks+channel+prada+tumi+vitton+rolex+gucchi+ralph

gen donotownbrand=1 if brandshopper==0
replace donotownbrand=0 if brandshopper>0

gen age_over50=1 if age>49 
replace age_over50=0 if age<50

gen college=1 if education>5
replace college=0 if education<6

gen group_prod_control=1 if producer==1
replace group_prod_control=0 if control==1

gen group_cons_control=1 if consumer==1
replace group_cons_control=0 if control==1

gen ldp=1 if party_id==1
replace ldp=0 if ldp==.
replace ldp=. if party_id>7

gen dpj=1 if q32==2
replace dpj=0 if dpj==.
replace dpj=. if party_id>7

gen noparty=1 if party_id==7
replace noparty=0 if noparty==.
replace noparty=. if  party_id>7

******Figure 2:Estimated Effect of Producer and Consumer-priming on Support for Free Trade*******

ttest support_freetrade, by(group_prod_control)
ttest support_freetrade, by(group_cons_control)

ttest oppose_freetrade, by(group_prod_control)
ttest oppose_freetrade, by(group_cons_control)

ttest neutral_freetrade, by(group_prod_control)
ttest neutral_freetrade, by(group_cons_control)

******Figure 3: Treatment Effects by Income Group (Also Table SI-5)******

ttest support_freetrade if lowincome==1, by(group_prod_control)
ttest support_freetrade if lowincome==1, by(group_cons_control)

ttest support_freetrade if midincome==1, by(group_prod_control)
ttest support_freetrade if midincome==1, by(group_cons_control)

ttest support_freetrade if highincome==1, by(group_prod_control)
ttest support_freetrade if highincome==1, by(group_cons_control)ttest bi_freetrade if highincome==1, by(group_cons_control)

****Figure 4:Treatment Effects by Shopping Habits ***** 

ttest support_freetrade if donotownbrand==1, by(group_pro_control)
ttest support_freetrade if donotownbrand==1, by(group_cons_control)

ttest support_freetrade if donotownbrand==0, by(group_pro_control)
ttest support_freetrade if donotownbrand==0, by(group_cons_control)

********Figure 5: Priming Effects by Partisanship (Also Table SI-5)*************

ttest support_freetrade if ldp==1, by(group_pro_control)
ttest support_freetrade if ldp==1, by(group_cons_control)

ttest support_freetrade if dpj==1, by(group_pro_control)
ttest support_freetrade if dpj==1, by(group_cons_control)
 
ttest support_freetrade if noparty==1, by(group_pro_control)
ttest support_freetrade if noparty==1, by(group_cons_control)

*****************Supplementary Materials****************************
****SI-2: Balanced Groups******

label var lowincome "low income"
label var midincome "mid income"
label var highincome "high income"
label var donotownbrand "Cheap Shoppers"
label var ldp "LDP"
label var dpj "DPJ"
label var noparty "Non Partisans"
label var female "female"
label var college "college"
label var age_over50 "age over 50"

ttest lowincome, by(group_pro_control)
ttest lowincome, by(group_cons_control)

ttest midincome, by(group_pro_control)
ttest midincome, by(group_cons_control)

ttest highincome, by(group_pro_control)
ttest highincome, by(group_cons_control)

ttest donotownbrand, by(group_pro_control)
ttest donotownbrand, by(group_cons_control)

ttest ldp, by(group_pro_control)
ttest ldp, by(group_cons_control)

ttest dpj, by(group_pro_control)
ttest dpj, by(group_cons_control)

ttest noparty, by(group_pro_control)
ttest noparty, by(group_cons_control)

ttest female, by(group_pro_control)
ttest female, by(group_cons_control)

ttest age_over50, by(group_pro_control)
ttest age_over50, by(group_cons_control)

****SI-3: 
gen group=1 if producer==1
replace group=2 if consumer==1
replace group=3 if control==1

by group, sort: tab freetrade

********SI-6: Treatment Effects for Sub-Groups with Co-Variates******
 
eststo clear
label var bi_freetrade "free trade" 
label var producer "producer treatment"
label var consumer "consumer treatment"
label var female "female"
label var college "college"
label var age_over50 "age over 50"
label var lowincome "low income"
label var midincome "mid income"
label var highincome "high income"
label var donotownbrand "Cheap Shoppers"
label var ldp "LDP"
label var dpj "DPJ"
label var noparty "Non Partisans"


eststo: reg support_freetrade producer consumer female college age_over50 if lowincome==1
eststo: reg support_freetrade producer consumer female college age_over50 if midincome==1
eststo: reg support_freetrade producer consumer female college age_over50 if highincome==1
eststo: reg support_freetrade producer consumer female college age_over50 lowincome highincome if donotownbrand==1
eststo: reg support_freetrade producer consumer female college age_over50 lowincome highincome if donotownbrand==0
eststo: reg support_freetrade producer consumer female college age_over50 lowincome highincome if dpj==1
eststo: reg support_freetrade producer consumer female college age_over50 lowincome highincome if ldp==1
eststo: reg support_freetrade producer consumer female college age_over50 lowincome highincome if noparty==1

esttab using "workersconsumers_regression.csv", se label title(Table 1) stats(r2) starlevels(* 0.10 ** 0.05 *** 0.01) br replace

